package com.appfahrt.persistence.obj2.dbo.generated;

import java.util.ArrayList;
import java.sql.Date;
import com.appfahrt.persistence.obj2.AbstractDatabaseObject;
import com.appfahrt.persistence.obj2.dao.generated.FahrzeugGeneratedDao;


/**
 * This Class is automatically generated.<br><br>
 *
 * <u><b>${schema}.fahrzeug</b></u><br><br>
 * 
 * <u><b>Table Definition:</b></u>
 * <table> 
 *   <tr> <th>Column-Name</th> <th>Data-Type</th> <th>Data-Length</th> <th>Nullable</th> <th>Description</th> </tr> 
 *   <tr> <td>ID </td> <td>INTEGER</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>marke </td> <td>VARCHAR</td> <td>45</td> <td>false</td> <td>-</td> 
 *   <tr> <td>modell </td> <td>VARCHAR</td> <td>45</td> <td>false</td> <td>-</td> 
 *   <tr> <td>baujahr </td> <td>date</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>anzahl_tueren </td> <td>integer</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>sitzplaetze </td> <td>integer</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>gepaeck </td> <td>boolean</td> <td>-1</td> <td>false</td> <td>-</td> 
 *   <tr> <td>weiter_informationen </td> <td>VARCHAR</td> <td>128</td> <td>false</td> <td>-</td> 
 *   <tr> <td>fk_id_profil </td> <td>integer</td> <td>-1</td> <td>false</td> <td>-</td> 
 * </table>
 * <br><br>
 * <u><b>References:</b></u> <br>
 *
 * <br><br>
 * <u><b>Indexes:</b></u> <br>
 *
 * <br><b>DON'T MODIFY THIS FILE</b><br><br>
 *
 * Generated: Sun May 22 22:20:17 CEST 2011
 */
public abstract class FahrzeugGeneratedDbo extends AbstractDatabaseObject {
	
	public static final String TABLE = "fahrzeug";
	
	public static final String SCHEMA = "$schema";

	protected ArrayList<String> changedFieldList = new ArrayList<String>();
	
	private boolean loadFromDb = false;

	// Database Column-Definition
	public static final String ID = "id"; 
	public static final String marke = "marke"; 
	public static final String modell = "modell"; 
	public static final String baujahr = "baujahr"; 
	public static final String anzahl_tueren = "anzahl_tueren"; 
	public static final String sitzplaetze = "sitzplaetze"; 
	public static final String gepaeck = "gepaeck"; 
	public static final String weiter_informationen = "weiter_informationen"; 
	public static final String fk_id_profil = "fk_id_profil"; 
	public final static String[] COLUMNS = {  ID , marke , modell , baujahr , anzahl_tueren , sitzplaetze , gepaeck , weiter_informationen , fk_id_profil  };

	// Members
			private Long Id = null;
				private String Marke = null;
				private String Modell = null;
				private Date Baujahr = null;
				private Long AnzahlTueren = null;
				private Long Sitzplaetze = null;
				private boolean Gepaeck = false;
				private String WeiterInformationen = null;
				private Long FkIdProfil = null;
	
	/** Value-Holder for the references **/
	private References references = new References();
	
	/**
	 * Value-Holder for the references.
	 */
	public class References {


	}

	/**
	 * Constructor.
	 */
	public FahrzeugGeneratedDbo() {
	
	}
	
	
	/**
	 * Returns the references.
	 */
	public References getReferences() {
		return this.references;
	}
	
	/**
	 * Setter for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setId(Long Id) {
				if (!(Id == null && this.Id == null) && !this.changedFieldList.contains("ID")) {
			this.changedFieldList.add("ID");
		}
		this.Id = Id ;
			}
	
	/**
	 * Getter for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getId () {
		return this.Id;
	}
	
	/**
	 * Equals-Method for <b>ID</b>  <br>
	 * Type: INTEGER <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsId(Long Id) {
		boolean result = false;
				if (getId () != null
			&& getId ().equals( Id )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>marke</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setMarke(String Marke) {
				if (!(Marke == null && this.Marke == null) && !this.changedFieldList.contains("marke")) {
			this.changedFieldList.add("marke");
		}
		this.Marke = Marke ;
			}
	
	/**
	 * Getter for <b>marke</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public String getMarke () {
		return this.Marke;
	}
	
	/**
	 * Equals-Method for <b>marke</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsMarke(String Marke) {
		boolean result = false;
				if (getMarke () != null
			&& getMarke ().equals( Marke )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>modell</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setModell(String Modell) {
				if (!(Modell == null && this.Modell == null) && !this.changedFieldList.contains("modell")) {
			this.changedFieldList.add("modell");
		}
		this.Modell = Modell ;
			}
	
	/**
	 * Getter for <b>modell</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public String getModell () {
		return this.Modell;
	}
	
	/**
	 * Equals-Method for <b>modell</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 45 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsModell(String Modell) {
		boolean result = false;
				if (getModell () != null
			&& getModell ().equals( Modell )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>baujahr</b>  <br>
	 * Type: date <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setBaujahr(Date Baujahr) {
				if (!(Baujahr == null && this.Baujahr == null) && !this.changedFieldList.contains("baujahr")) {
			this.changedFieldList.add("baujahr");
		}
		this.Baujahr = Baujahr ;
			}
	
	/**
	 * Getter for <b>baujahr</b>  <br>
	 * Type: date <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Date getBaujahr () {
		return this.Baujahr;
	}
	
	/**
	 * Equals-Method for <b>baujahr</b>  <br>
	 * Type: date <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsBaujahr(Date Baujahr) {
		boolean result = false;
				if (getBaujahr () != null
			&& getBaujahr ().equals( Baujahr )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>anzahl_tueren</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setAnzahlTueren(Long AnzahlTueren) {
				if (!(AnzahlTueren == null && this.AnzahlTueren == null) && !this.changedFieldList.contains("anzahl_tueren")) {
			this.changedFieldList.add("anzahl_tueren");
		}
		this.AnzahlTueren = AnzahlTueren ;
			}
	
	/**
	 * Getter for <b>anzahl_tueren</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getAnzahlTueren () {
		return this.AnzahlTueren;
	}
	
	/**
	 * Equals-Method for <b>anzahl_tueren</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsAnzahlTueren(Long AnzahlTueren) {
		boolean result = false;
				if (getAnzahlTueren () != null
			&& getAnzahlTueren ().equals( AnzahlTueren )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>sitzplaetze</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setSitzplaetze(Long Sitzplaetze) {
				if (!(Sitzplaetze == null && this.Sitzplaetze == null) && !this.changedFieldList.contains("sitzplaetze")) {
			this.changedFieldList.add("sitzplaetze");
		}
		this.Sitzplaetze = Sitzplaetze ;
			}
	
	/**
	 * Getter for <b>sitzplaetze</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getSitzplaetze () {
		return this.Sitzplaetze;
	}
	
	/**
	 * Equals-Method for <b>sitzplaetze</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsSitzplaetze(Long Sitzplaetze) {
		boolean result = false;
				if (getSitzplaetze () != null
			&& getSitzplaetze ().equals( Sitzplaetze )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>gepaeck</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setGepaeck(boolean Gepaeck) {
				this.Gepaeck = Gepaeck ;
			}
	
	/**
	 * Getter for <b>gepaeck</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean getGepaeck () {
		return this.Gepaeck;
	}
	
	/**
	 * Equals-Method for <b>gepaeck</b>  <br>
	 * Type: boolean <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsGepaeck(boolean Gepaeck) {
		boolean result = false;
				result = getGepaeck ()==Gepaeck;
				return result;
	} 
	/**
	 * Setter for <b>weiter_informationen</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 128 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setWeiterInformationen(String WeiterInformationen) {
				if (!(WeiterInformationen == null && this.WeiterInformationen == null) && !this.changedFieldList.contains("weiter_informationen")) {
			this.changedFieldList.add("weiter_informationen");
		}
		this.WeiterInformationen = WeiterInformationen ;
			}
	
	/**
	 * Getter for <b>weiter_informationen</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 128 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public String getWeiterInformationen () {
		return this.WeiterInformationen;
	}
	
	/**
	 * Equals-Method for <b>weiter_informationen</b>  <br>
	 * Type: VARCHAR <br>
	 * Length: 128 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsWeiterInformationen(String WeiterInformationen) {
		boolean result = false;
				if (getWeiterInformationen () != null
			&& getWeiterInformationen ().equals( WeiterInformationen )) {
			result = true;
		}
				return result;
	} 
	/**
	 * Setter for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public void setFkIdProfil(Long FkIdProfil) {
				if (!(FkIdProfil == null && this.FkIdProfil == null) && !this.changedFieldList.contains("fk_id_profil")) {
			this.changedFieldList.add("fk_id_profil");
		}
		this.FkIdProfil = FkIdProfil ;
			}
	
	/**
	 * Getter for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public Long getFkIdProfil () {
		return this.FkIdProfil;
	}
	
	/**
	 * Equals-Method for <b>fk_id_profil</b>  <br>
	 * Type: integer <br>
	 * Length: -1 <br>
	 * Nullable: false <br>
	 * Comment: - <br>
	 */
	public boolean equalsFkIdProfil(Long FkIdProfil) {
		boolean result = false;
				if (getFkIdProfil () != null
			&& getFkIdProfil ().equals( FkIdProfil )) {
			result = true;
		}
				return result;
	} 

	/**
	 * Returns a short String with the values.
	 */
	public String toInfoShortString() {
		return  "[ID=" + this.Id+"]" +"-[marke="+this.Marke + "]" +"-[modell="+this.Modell + "]" +"-[baujahr="+this.Baujahr + "]" +"-[anzahl_tueren="+this.AnzahlTueren + "]" +"-[sitzplaetze="+this.Sitzplaetze + "]" +"-[gepaeck="+this.Gepaeck + "]" +"-[weiter_informationen="+this.WeiterInformationen + "]" +"-[fk_id_profil="+this.FkIdProfil + "]" ;
	}
	
	/**
	 * Returns a Comma-Separated Values (CSV) String. <br>
	 * Separator: ;
	 */
	public String toCsvString() {
		return toCsvString(";");
	}
	
	/**
	 * Returns a Comma-Separated Values (CSV) String
	 * with the given separator.
	 */
	public String toCsvString(String separator) {
		return  this.Id+separator+this.Marke+separator+this.Modell+separator+this.Baujahr+separator+this.AnzahlTueren+separator+this.Sitzplaetze+separator+this.Gepaeck+separator+this.WeiterInformationen+separator+this.FkIdProfil;
	}
	
	/**
	 * Indicates whether the object has 
	 * changed or not.
	 */
	public boolean hasChanged() {
		return this.changedFieldList.size() > 0;
	}
	
	/**
	 * Changes Fields.
	 */
	public ArrayList<String> getChangedFieldList() {
		return this.changedFieldList;
	}
	
	/**
	 * Indicates, whether the object is new 
	 * or exists in the database.
	 */ 
	public boolean isNew() {
		return !loadFromDb;
	}
	
	/**
	 * Returns the name of the corresponding database table.
	 */
	public String getTable() {
		return TABLE;
	}
	
	/**
	 * Returns the name of the corresponding database schema.
	 */
	public String getSchema() {
		return SCHEMA;
	}
}